<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<h:outputScript library="js" name="filetypes.js" />
</h:head>	
<h:body>
	<f:metadata>
		<f:event listener="#{eventBean.initForAdd}" type="preRenderView"></f:event>
	</f:metadata>

	<f:view>
		<ui:composition template="WEB-INF/templates/template.xhtml">
		<ui:define name="content">

  <!-- Three-up Content Blocks -->
	<h:form enctype="multipart/form-data">
  		<div class="row">
  		<h2>Neues Event hinzufügen:</h2>

    		<div class="four columns">
    			<p>Füge hier ganz einfach und schnell ein neues Event hinzu.</p>
   			</div>

    		<div class="six columns">
    			<div class="row">
    				 <p>Event-Location Informationen:</p>
    				<div class="four columns"><label for="name">Name des Events:</label></div>
    				<div class="eight columns"><h:inputText id="name" value="#{eventBean.eventName}" name="name"><f:validator validatorId="EventNameValidator"/></h:inputText>
    				<p:message for="name" /></div>
    			</div>
    			
    			 <div class="row">
    				<div class="four columns"><label for="location">Location:</label></div>
    				<div class="eight columns"><h:inputText id="location" value="#{eventBean.name}" name="location"><f:validator validatorId="EventLocationValidator"/></h:inputText>
    				<p:message for="location" /></div>
    			</div>
    		
    			<div class="row">
    				<div class="four columns"><label for="city">Stadt:</label></div>
    				<div class="eight columns"><h:inputText id="city" value="#{eventBean.city}" name="city"><f:validator validatorId="EventCityValidator"/></h:inputText>
    				<p:message for="city" /></div>
    			</div>
    		
    			<div class="row">
    				<div class="four columns"><label for="zip">PLZ:</label></div>
    				<div class="eight columns"><h:inputText id="zip" value="#{eventBean.zip}" name="zip"><f:validator validatorId="EventZipValidator"/></h:inputText>
    				<p:message for="zip" /></div>
    			</div>
    		
    			<div class="row">
    				<div class="four columns"><label for="street">Stra&szlig;e:</label></div>
    				<div class="eight columns"><h:inputText id="street" value="#{eventBean.street}" name="street"><f:validator validatorId="EventStreetValidator"/></h:inputText>
    				<p:message for="street" /></div>
    			</div>
    		
    			<div class="row">
    				<div class="four columns"><label for="country">Staat:</label></div>
    				<div class="eight columns"><h:inputText id="country" value="#{eventBean.country}" name="country"><f:validator validatorId="EventCountryValidator"/></h:inputText>
    				<p:message for="country" /></div>
    			</div>
    		
    			<div class="row">
    				<div class="four columns"><label for="date">Datum:</label></div>
    				<div class="eight columns"><h:inputText id="date" value="#{eventBean.date}" name="date"><f:validator validatorId="EventDateValidator"/></h:inputText>
    				<p:message for="date" /></div>
    			</div>
    			
    			<div class="row">
    				<h:inputHidden value="true" id="time">
       			    	<f:validator validatorId="ValidTimesValidator" />
        				<f:attribute name="validenter" value="#{enter}" />
       					<f:attribute name="validbegin" value="#{begin}" />
    				</h:inputHidden>
    			</div>
    		
    			<div class="row">
    				<div class="four columns"><label for="enter">Einlass:</label></div>
    				<div class="eight columns"><h:inputText binding="#{enter}" id="enter" value="#{eventBean.enter}" name="enter"><f:validator validatorId="EventEntryValidator"/></h:inputText>
    				<p:message for="enter" /></div>
    			</div>
    		
    			<div class="row">
    				<div class="four columns"><label for="begin">Beginn der Veranstaltung:</label></div>
    				<div class="eight columns"><h:inputText binding="#{begin}" id="begin" value="#{eventBean.begin}" name="begin"><f:validator validatorId="EventStartValidator"/></h:inputText>
    				<p:message for="begin" />
    				<p:message for="time" /></div>
    			</div>
   
    			<div class="row">
    			 	<p>Beschreibung des Events:</p>
    			 
    				<div class="four columns"><label for="description">Information:</label></div>
    				<div class="eight columns"><h:inputTextarea id="description" value="#{eventBean.description}" name="description" rows="8"><f:validator validatorId="EventDescriptionValidator"/></h:inputTextarea>
    				<p:message for="description" /></div>
				</div>
				
				<div class="row">
					<div class="four columns"><label for="eventtype">Eventtyp:</label></div>
					<div class="eight columns">
						<h:selectOneMenu value="#{eventBean.eventType}">
   							<f:selectItems value="#{eventBean.eventtypes}" var="item" itemLabel="#{item.text}" itemValue="#{item.id}"/>
						</h:selectOneMenu>
					</div>
				</div>
    		
				<div class="row">
					<p>Ticket-Informationen:</p>
    			 
					<div class="four columns"><label for="standing_price">Ticketpreis Stehplatz:</label></div>
    				<div class="eight columns"><h:inputText id="standing_price" value="#{eventBean.standingPrice}" name="standing_price"><f:validator validatorId="TicketPriceValidator"/></h:inputText>
    				<p:message for="standing_price" /></div>
    			</div>
    			
    			<div class="row">
    				<div class="four columns"><label for="seat_price">Ticketpreis Sitzplatz:</label></div>
    				<div class="eight columns"><h:inputText id="seat_price" value="#{eventBean.seatPrice}" name="seat_price"><f:validator validatorId="TicketPriceValidator"/></h:inputText>
    				<p:message for="seat_price" /></div>
    			</div>
    			
    			<div class="row">
    				<div class="four columns"><label for="loge_price">Ticketpreis Logenplatz:</label></div>
    				<div class="eight columns"><h:inputText id="loge_price" value="#{eventBean.logePrice}" name="loge_price"><f:validator validatorId="TicketPriceValidator"/></h:inputText>
    				<p:message for="loge_price" /></div>
				</div>
    		
				<div class="row">
					<div class="four columns"><label for="standing_amount">Anzahl der vorhandenen Stehplatz-Tickets:</label></div>
					<div class="eight columns"><h:inputText id="standing_amount" value="#{eventBean.standingAmount}" name="standing_amount"><f:validator validatorId="TicketAmountValidator"/></h:inputText>
					<p:message for="standing_amount" /></div>
				</div>
				
				<div class="row">
					<div class="four columns"><label for="seat_amount">Anzahl der vorhandenen Sitzplatz-Tickets:</label></div>
					<div class="eight columns"><h:inputText id="seat_amount" value="#{eventBean.seatAmount}" name="seat_amount"><f:validator validatorId="TicketAmountValidator"/></h:inputText>
					<p:message for="seat_amount" /></div>
				</div>
				
				<div class="row">
					<div class="four columns"><label for="loge_amount">Anzahl der vorhandenen Logen-Tickets:</label></div>
					<div class="eight columns"><h:inputText id="loge_amount" value="#{eventBean.logeAmount}" name="loge_amount"><f:validator validatorId="TicketAmountValidator"/></h:inputText>
					<p:message for="loge_amount" /></div>
				</div>
    		
				<div class="row">
					<p>Flyer oder Bild hinzufügen:</p>
    			 
					<div class="four columns"><label for="flyer">Flyer:</label></div>
					<div class="eight columns"><p:fileUpload value="#{eventBean.flyer}" mode="simple"/></div>
				</div>
      		
				<div class="row">
					<div class="four columns">&nbsp;</div>
					<div class="eight columns"><h:commandButton value="Event veröffentlichen" action="#{eventBean.saveNewEvent()}"/></div>
				</div>
				
			</div>
    	
			<hr />

		</div>
    
    <div class="two columns">&nbsp;</div>
    
	</h:form>
<hr />





  <!-- Call to Action Panel -->
  <!--
  <div class="row">
    <div class="twelve columns">

      <div class="panel">
        <h4>Get in touch!</h4>

        <div class="row">
          <div class="nine columns">
            <p>We'd love to hear from you, you attractive person you.</p>
          </div>
          <div class="three columns">
            <a href="#" class="radius button right">Contact Us</a>
          </div>
        </div>
      </div>

    </div>
  </div>
  -->
		    
		    </ui:define>
		    
		    <!-- Um das MenÃ¼ im Footer zu Ã¤ndern -->
		    <!-- <ui:define name="footer">
		    
		    </ui:define>-->
    
	    </ui:composition>
	</f:view>

</h:body>
</html>
